package net.randomice.emf.observables.generator.util;

import java.util.Collection;
import java.util.Collections;

import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;

public class GenClassHelper {
	public static String getQualifiedInterfaceName(GenClass c) {
		return c.getQualifiedInterfaceName();
	}

	public static String getInterfaceName(GenClass c) {
		return c.getInterfaceName();
	}

	public static String getGetAccessor(GenFeature f) {
		return f.getGetAccessor();
	}

	public static String getQualifiedFactoryName(GenClass c) {
		return c.getGenPackage().getQualifiedEFactoryInstanceAccessor()
				+ ".create" + c.getInterfaceName();
	}

	public static String getQualifiedClassifierAccessor(GenClassifier c){
		return c.getQualifiedClassifierAccessor();
	}
	@SuppressWarnings("unchecked")
	public static Collection<GenClass> getAllBaseGenClasses(GenClass c) {
		return null != c ? c.getAllBaseGenClasses() : Collections.EMPTY_LIST;
	}
	public static Collection<GenFeature> getAllGenFeatures(GenClass c){
		return c.getAllGenFeatures();
	}
	
	public static String getObservableListPostfix(){
		return "OL";
	}
	public static String getObservableObjectPostfix(){
		return "OO";
	}
	public static String getObservableMapPostfix(){
		return "OM";
	}
	public static String getObservableSetPostfix(){
		return "OS";
	}
	
	public static String getImportedParameterizedInstanceClassName(GenClassifier c){
		return c.getImportedParameterizedInstanceClassName();
	}
}
